Log in Register Dashboard Temp Share Shortlinks Frames API

cody - HTMLify profile

cody's Profile Picture

cody

4270 Files

633421 Views

Latest files of /cody/swapnilsparsh/30DaysOfJavaScript/71 - Background Color Changer

app.js cody/swapnilsparsh/30DaysOfJavaScript/71 - Background Color Changer/app.js
187 Views
0 Comments
const colors = ["green ","red","rgba(133,122,200)","#f15025"];
const btn=document.getElementById('btn');
const color =document.querySelector(".bg");

btn.addEventListener('click', ()=>{
//get randomg nu. between 0-3
const randomNo = Math.floor(random() * colors.length );
console.log(randomNo);
hex.html cody/swapnilsparsh/30DaysOfJavaScript/71 - Background Color Changer/hex.html
334 Views
0 Comments
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
style.css cody/swapnilsparsh/30DaysOfJavaScript/71 - Background Color Changer/style.css
144 Views
0 Comments
*{
margin: 0;
padding: 0;

}

a{
text-decoration: none;
Baackground Color Changer cody/swapnilsparsh/30DaysOfJavaScript/71 - Background Color Changer/index.html
321 Views
0 Comments
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
hex.js cody/swapnilsparsh/30DaysOfJavaScript/71 - Background Color Changer/hex.js
193 Views
0 Comments
const hex= [0,1,2,3,4,5,6,7,8,9, "A" ,"B" ,"C","D","E","F"];

const btn= document.getElementById("btn");
const color=document.querySelector(".bg");

btn.addEventListener('click', ()=>{
let hexColor ='#';